<?php

/*
 * login/register
 * @author sky
 * create_time 2017-04-30
 */


namespace App\Front\Controllers\Index;

use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Illuminate\Support\Str;
use Intervention\Image\Constraint;
use App\Admin\Controllers\Controller;
use App\Admin\Models\Logs;
use App\Admin\Models\UploadImg;
use App\Front\Models\Register;


class RegisterController extends Controller {


    /*
     * login/resigister
     * @author sky
     * create_time 2017-04-30
     */
    public function register(Request $request) {
        return view('front.register');
    }
    public function goregister(Request $request) {
        $image = $request->file('images');
        $data = UploadImg::upload($image, 'goods');
        $adduser = array(
            'nick' => $request['nick'],
            'name' => $request['name'],
            'password' => $request['password'],
            'reg_data' => date('y-m-d h:i:s',time()),   
            'img' => $data
        );
        // dd($adduser);
        Register::Register($adduser);
        return view('front.login');
    }
}